<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="wf" uri="/augurit-wf"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<script type='text/javascript' src="${ctx}/dwr/engine.js"></script>
<script type='text/javascript' src="${ctx}/dwr/util.js"></script>
<script type='text/javascript' src="${ctx}/dwr/interface/FileUploadCntl.js"></script>
<script src="${ctx}/gzcgwsp/resources/js/YwUtil.js" type="text/javascript"></script>
<link href="${ctx}/gzcgwsp/resources/css/common-ui.css" rel="stylesheet" type="text/css" />
<script src="${ctx}/gzcgwsp/resources/js/YwEnterprise.js" type="text/javascript"></script>
<script src="${ctx}/resources/js/jquery/jquery.js" type="text/javascript"></script>
<script src="${ctx}/gzcgwsp/shljcz/js/csshljcz.js" type="text/javascript"></script>
<%@ include file="/wf/public/meta_wf.jsp"%>
<%@ include file="/common/meta.jsp"%>

<script src="${ctx}/gzcgwsp/resources/js/YwUtil.js" type="text/javascript"></script>
<link href="${ctx}/gzcgwsp/resources/css/common-ui.css" rel="stylesheet" type="text/css" />

</head>
<body>
<script type="text/javascript">
	function toAdd(){
	  var url = '${ctx}/csshljclc!toSave.action?czid='+$("#czid").val();
	   YwUtil.openWin({url: url, w: 850, h: 600});
	  /*win=new Ext.Window({
        title:'新增燃气设施',
        width:1000,
        height:800,
        autoHeight:true,    
        modal: true,
        labelAlign:'right',
        buttonAlign:'center',
        closeAction:'close',
        html:'<iframe  src="'+url+'" id="ccljcl" name="ccljcl" frameBorder="0" scrolling="auto" top="0" width="100%" height="100%"></iframe>',
        buttons:[{text:'保 存',handler:dosave},{text:'取 消',handler:function(){
            win.close();
        }}]
    });*/
      //win.show();
	}
	
	function toUpdate(){
		   var id=getOneId("id");
		   if(checkOneSelect("id")){
		   	var url="${ctx}/csshljclc!toUpdate.action?czid="+$("#czid").val()+"&clcId="+id;
		
			YwUtil.openWin({url: url, w: 850, h: 600});
	   	}
	}

/**
 * 全选/全不选函数
 * @param checkboxName 需要被设置的checkbox或checkbox数组控件的name属性所指定的名称
 * @param checkallObj 全选checkbox控件元素
 */
	
function checkAll(checkboxName, checkallId){
	var checkallObj=document.getElementById(checkallId)
    var ids = document.getElementsByName(checkboxName);
    if(ids != null){
        var ischeckall = checkallObj.checked;   
        //如果ids为一项checkbox
        if(ids.type == "checkbox"){
            ids.checked = ischeckall;
            return;
        }
        //如果ids为checkbox数组
        for(var i=0; i<ids.length; i++){
            ids[i].checked = ischeckall;
        }
    }
}

 //验证是否单选
function checkOneSelect(idname){
    var id=getOneId(idname);
     if(id==""){
        alert('请选择单条数据');
        return false;
    }
    var idArr=id.split(",");
    if(id.length>1){
        alert('请选择单条数据');
        return false;
    }
    return true;
}
 
//验证是否得到一个id
function getOneId(idname){
    var ids=document.getElementsByName(idname);
    var id="";
    for(var i=0; i<ids.length; i++){
        if(ids[i].checked==true){
            id+=ids[i].value+",";
        }
    }
   if(id!=""){
        id=id.substring(0,id.length-1);
    }
    return id;
};
 
</script>
<form action="">
<input type="hidden" name="czid" id="czid" value="${czid}"/> 
 <table width="1000" align="center" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" >
          <tr>
	          <td height="55" bordercolor="#000000" align="center" style="font-size:22px;">
	            <br/><b>城市生活垃圾处理场(厂)</b> <br/>
	          </td>
          </tr>
        </table>
        </td>
      </tr>
       <tr>
         <td>
           <table width="100%"  id="" width="100%"  border="1" bordercolor="#000000" cellspacing="0" cellpadding="0" class="tpl_list_ui" id="myTable">
            <tbody id="">
	           	<tr id="myTr0" align="center">
	           	<td height="25" width="8%" align="center" bordercolor="#000000"><input type="checkbox" id="checkall" name="checkall"  onclick="javascript:checkAll('id','checkall');"></td>
	             <td height="25" width="8%" align="center" bordercolor="#000000">序号</td>
	             <td height="25" width="35%" align="center" bordercolor="#000000">地址</td>
	             <td height="25" width="10%"  align="center" bordercolor="#000000">处理能力(吨/天 )</td>
	             <td height="25" width="10%" align="center" bordercolor="#000000">双向称重</td>
	             <td height="25" width="10%" align="center" bordercolor="#000000">甲烷监测仪</td>
	             <td height="25" width="10%" align="center" bordercolor="#000000">在线监测仪</td>
	    	    </tr>
	    	   <% int k=1; %>
	             <c:forEach var="form" items="${list}">
	                    <tr  align="center">
	                       <td height="25" width="8%" align="center" bordercolor="#000000"><input type="checkbox"  name='id'  value="${form.clcId}"></td>
	                        <td height="25" align="center" bordercolor="#000000"> <%=k++%></td>
	                        <td height="25" align="center" bordercolor="#000000">${form.address}</td>
	                        <td height="25" align="center" bordercolor="#000000">${form.clnl}</td>
	                        <td height="25" align="center" bordercolor="#000000">${form.address}</td>
	                         <td height="25" align="center" bordercolor="#000000">${form.address}</td>
	                          <td height="25" align="center" bordercolor="#000000">${form.address}</td>
	                   </tr>
	             </c:forEach>
	         
           </tbody>
           </table>
           </td>
         </tr>
         <tr > 
         	<td colspan="7" bordercolor="#000000">&nbsp;</td>
         </tr>
         <tr>
         	 <td colspan="7" bordercolor="#000000">
             	 <input type="button" value="新增" onclick="toAdd()">&nbsp;&nbsp;
              	 <input type="button" value="修改" onclick="toUpdate()">&nbsp;&nbsp;
               	 <input type="button" value="删除" onclick="doDelete()">&nbsp;&nbsp;
               	 <input type="button" value="查看" onclick="view()"> 
               </td>
         </tr>
    </table>
</form>
    </body>
    </html>